package com.xuecheng.comment.convert;

import com.xuecheng.api.comment.model.dto.CommentDTO;
import com.xuecheng.api.comment.model.vo.CommentVO;
import com.xuecheng.comment.entity.Comment;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

import java.util.List;

@Mapper
public interface CommentConvert {

    CommentConvert INSTANCE = Mappers.getMapper(CommentConvert.class);

    CommentDTO vo2dto(CommentVO vo);

    //dto转po
    Comment dto2po(CommentDTO dto);

    //dto转po
    @Mapping (source = "id", target = "commentId")
    CommentDTO po2dto(Comment comment);


    List<CommentDTO> entitys2dtos(List<Comment> commentList);



}
